/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Clases;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Bryan
 */
@Entity
@Table(name = "planificacion")
@NamedQueries({
    @NamedQuery(name = "Planificacion.findAll", query = "SELECT p FROM Planificacion p"),
    @NamedQuery(name = "Planificacion.findByIdPlanificacion", query = "SELECT p FROM Planificacion p WHERE p.idPlanificacion = :idPlanificacion"),
    @NamedQuery(name = "Planificacion.findByNotaAprobacion", query = "SELECT p FROM Planificacion p WHERE p.notaAprobacion = :notaAprobacion"),
    @NamedQuery(name = "Planificacion.findByZona", query = "SELECT p FROM Planificacion p WHERE p.zona = :zona"),
    @NamedQuery(name = "Planificacion.findByExamenFinal", query = "SELECT p FROM Planificacion p WHERE p.examenFinal = :examenFinal"),
    @NamedQuery(name = "Planificacion.findByExamenParcial", query = "SELECT p FROM Planificacion p WHERE p.examenParcial = :examenParcial"),
    @NamedQuery(name = "Planificacion.findByOtros", query = "SELECT p FROM Planificacion p WHERE p.otros = :otros")})
public class Planificacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idPlanificacion")
    private Short idPlanificacion;
    @Basic(optional = false)
    @Column(name = "NotaAprobacion")
    private short notaAprobacion;
    @Basic(optional = false)
    @Column(name = "Zona")
    private float zona;
    @Basic(optional = false)
    @Column(name = "ExamenFinal")
    private short examenFinal;
    @Basic(optional = false)
    @Column(name = "ExamenParcial")
    private short examenParcial;
    @Column(name = "Otros")
    private short otros;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "planificacion")
    private Collection<Unidad> unidadCollection;

    public Planificacion() {
    }

    public Planificacion(Short idPlanificacion) {
        this.idPlanificacion = idPlanificacion;
    }

    public Planificacion(Short idPlanificacion, short notaAprobacion, float zona, short examenFinal, short examenParcial,short otros) {
        this.idPlanificacion = idPlanificacion;
        this.notaAprobacion = notaAprobacion;
        this.zona = zona;
        this.examenFinal = examenFinal;
        this.examenParcial = examenParcial;
        this.otros = otros;
    }

    

    public Short getIdPlanificacion() {
        return idPlanificacion;
    }

    public void setIdPlanificacion(Short idPlanificacion) {
        this.idPlanificacion = idPlanificacion;
    }

    public short getNotaAprobacion() {
        return notaAprobacion;
    }

    public void setNotaAprobacion(short notaAprobacion) {
        this.notaAprobacion = notaAprobacion;
    }

    public float getZona() {
        return zona;
    }

    public void setZona(float zona) {
        this.zona = zona;
    }

    public short getExamenFinal() {
        return examenFinal;
    }

    public void setExamenFinal(short examenFinal) {
        this.examenFinal = examenFinal;
    }

    public short getExamenParcial() {
        return examenParcial;
    }

    public void setExamenParcial(short examenParcial) {
        this.examenParcial = examenParcial;
    }

    public Short getOtros() {
        return otros;
    }

    public void setOtros(Short otros) {
        this.otros = otros;
    }

    public Collection<Unidad> getUnidadCollection() {
        return unidadCollection;
    }

    public void setUnidadCollection(Collection<Unidad> unidadCollection) {
        this.unidadCollection = unidadCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPlanificacion != null ? idPlanificacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Planificacion)) {
            return false;
        }
        Planificacion other = (Planificacion) object;
        if ((this.idPlanificacion == null && other.idPlanificacion != null) || (this.idPlanificacion != null && !this.idPlanificacion.equals(other.idPlanificacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escuela.Planificacion[idPlanificacion=" + idPlanificacion + "]";
    }

}
